import random
import re
import time


# 生成一个随机字母组成的列表
# a = []
# n = 5
# for i in range(20):
#     s = ''
#     for j in range(n):
#         t = chr(random.randint(65, 90))
#         s += t
#     a.append(s)


def random_char(uppr=True):
    if uppr:
        t = random.randint(ord('A'), ord('Z'))
        return chr(t)
    else:
        t = random.randint(ord('a'), ord('z'))
        return chr(t)


def random_string(length):
    s = ''
    for i in range(length):
        s += random_char(random.choice([True, False]))
    return s


def yzm(length):
    return random_string(length)


def is_phone_number(phone):
    result = re.match(r'^1\d{10}$', phone)
    if result is None:
        return '非法的手机号'
    else:
        return '正确的手机号'


def get_time():
    t = time.localtime()
    s = time.strftime('%Y-%m-%d %H:%M:%S', t)
    return s

def main():
    # a = []
    # for i in range(20):
    #     a.append(random_string(random.randint(3, 6)))
    # print(a)
    print(yzm(8))
